package cn.itwangxiang.android.ui;

import cn.itwangxiang.android.R;
import android.app.Activity;
import android.os.Bundle;
import android.text.Html;
import android.text.method.LinkMovementMethod;
import android.widget.TextView;

public class DemoUIText extends Activity {

	private TextView textView1, textView2;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.demo_ui);

		initView();
		
		String html = "<font color='red'>Android TextView</font>&nbsp;";
		html+="<font color='#0000ff'><big><i>Android TextView<i><big></font><br>";
		html+="网址：<a href='http://www.baidu.com'><big>百度</big></a>&nbsp;";
		html+="拨号：<a href='tel:15961412132'><small>15961412132</small></a>";
		CharSequence chSequence = Html.fromHtml(html);
		textView1.setText(chSequence);
		textView1.setMovementMethod(LinkMovementMethod.getInstance());
		
		String text = "网址: http://www.baidu.com\n";
		text+="email: 913083524@qq.com\n";
		text+="拨号：+8615961412132";
		textView2.setText(text);
		
	}

	private void initView() {
		textView1 = (TextView) findViewById(R.id.textView1);
		textView2 = (TextView) findViewById(R.id.textView2);
	}
}
